package org.breathe.dynamic.thread.pool.example.controller;

import org.breathe.dynamic.thread.pool.core.ai.BreatheDtpAiHelper;
import org.breathe.dynamic.thread.pool.core.ai.assistant.Assistant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: breathe
 * @createTime: 2025-06-28
 */
@RestController
public class AiController {

    @Autowired
    private BreatheDtpAiHelper breatheDtpAiHelper;
    @GetMapping("/ai")
    public String ai(@RequestParam("userMessage") String userMessage) {
        Assistant assistant = breatheDtpAiHelper.getAssistant();
        return assistant.chatByBlocking(userMessage);
    }
}
